using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MessCenter<T> : Singleton<MessCenter<T>>
{
    Dictionary<int, Action<T>> dic = new Dictionary<int, Action<T>>();
    public void AddLister(int id,Action<T> action)
    {
        if (dic.ContainsKey(id))
        {
            dic[id] += action;
        }
        else
        {
            dic.Add(id, action);
        }
    }
    public void DisPath(int id,T info)
    {
        if(dic.ContainsKey(id))
        {
            dic[id](info);
        }
    }
}
